package com.runshu.exception;

/**
 * description: 全局通用错误码
 * @author don
 * @date 2015年7月22日 下午5:53:07
 *
 */
public enum ComErrorCode implements ErrorEnum {

    ERROR_SERVER_NO_RESPONSE(11, "服务器无响应"),
    ERROR_SERVER_NO_URL(404, "无效URL"),
    ERROR_SERVER_CANNOT_PARSING(500, "无法解析的错误"),
    ERROR_SERVER_INTERNAL(501, "HTTP无法解析的错误"),//非500/200/404的http错误
    ERROR_NO_PERMISSIONS(505, "无权限"),

    ERROR_ILLEGAL_PARAMETER(COMMON + 1, "传入参数不合法"),
    ERROR_DATA_NOT_EXIST(COMMON + 2, "查询的数据不存在"),
    ERROR_ILLEGAL_SQL_INSERT(COMMON + 3, "数据库插入异常"),
    ERROR_ILLEGAL_SQL_UPDATE(COMMON + 4, "数据库更新异常"),
    ERROR_ILLEGAL_TIME(COMMON + 5, "错误的时间格式"),
    ERROR_NULL_ID(COMMON + 6, "ID不能为空"),
    ERROR_NOT_SUPPORT_METHOD(COMMON + 7, "请求类型不正确"),
    ERROR_ILLEGAL_PHONE_NUM(COMMON + 8, "手机号格式错误"),
    ERROR_BEAN_TRANSFORM(COMMON + 9, "bean转换错误"),
    ERROR_HttpMessageNotReadable(COMMON + 10, "HTTP传入参数不合法"),
    ERROR_BUSY(COMMON + 11, "系统处理中，请稍后再试"),
    ERROR_HAS_REFERENCE(COMMON + 12, "存在引用"),
    ERROR_ILLEGAL_PARAMETER_1(COMMON + 21, "传入参数类型不匹配"),
    ERROR_ILLEGAL_PARAMETER_2(COMMON + 22, "传入参数不能为空"),
    ERROR_TITLE(COMMON + 23, "消息类型标题不能重复"),
    ERROR_MESSAGE_TYPE(COMMON + 24, "消息类型不能重复"),
    ERROR_NOT_NULL_PRODUCT_ORDER(COMMON + 25, "产品订单不能为空"),
    ERROR_CHANGE_PRODUCT_ORDER(COMMON + 26, "产品订单已生成运维订单"),
    ERROR_NOT_NULL_REPAIR_BILL_ORDER(COMMON + 29, "报修单不能为空"),
    ERROR_CHANGE_REPAIR_BILL_ORDER(COMMON + 30, "报修单已生成运维订单"),
    ERROR_NOT_NULL_DEPOSIT_ORDER(COMMON + 27, "押金订单不能为空"),
    ERROR_CHANGE_DEPOSIT_ORDER(COMMON + 28, "押金订单已生成运维订单"),
    ERROR_ORDER_STATUS_ORDER(COMMON + 29, "订单状态不正确"),

    ERROR_PACKAGE_TYPE_EXIST(COMMON + 30, "类型指定套餐,套餐类型不能为空"),

    ERROR_DEV_USING(COMMON + 40, "设备用水中"),


    ERROR_REDIS_MISS(COMMON + 50, "锁初始化失败"),
    ERROR_ILLEGAL_LOCKER(COMMON + 51, "解锁人不匹配"),
    ERROR_BIZ_EXEC(COMMON + 52, "业务执行错误"),

    ERROR_NO_API_TOKEN(COMMON + 60, "未获取到微信的API TOKEN,请确认微信公众号与平台对接参数配置正确"),



    ;

    private int ErrorCode;// 返回码
    private String ErrorMsg;// 错误信息

    private ComErrorCode(Integer code, String msg) {
        this.ErrorCode = code;
        this.ErrorMsg = msg;
    }

    @Override
    public int Code() {
        return ErrorCode;
    }

    @Override
    public String Msg() {
        return ErrorMsg;
    }

}
